package swing.renderer;

import java.lang.reflect.Field;

import javax.swing.JTextField;

public class IntegerRenderer extends Renderer{

	JTextField jtf;
	
	public IntegerRenderer(Field field, String name, String desctiption, String iconURL, Object initialValue) {
		super(field, name, desctiption, iconURL, initialValue);

		jtf =new JTextField(initialValue+"");
		jtf.setToolTipText(description);
		add(jtf);
		jtf.setName(name);
	
	}

	@Override
	public Object getValue() {
		int value=0;
		try {
			value = Integer.parseInt(jtf.getText());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;
	}

}
